﻿using MengLin.OOP.DesignPattern.WMS_LC4.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.WMS_LC4.Implements.HardwarePlatform
{
    /// <summary>
    /// Nimbus2.0硬件平台调度器
    /// </summary>
    /// <returns></returns>
    public class Nimbus2Scheduler : AbstractScheduler
    {
        public static int TicCount = 0;
        /// <summary>
        /// 每10ms调用1次
        /// </summary>
        public override void Tic()
        {
            Console.WriteLine($"{nameof(Nimbus2Scheduler)} Tic");
            //每1分钟读取温度
            if (TicCount != 0 && TicCount % 6 == 0)
            {
                TemperatureSensor.Read();
            }

            //每5分钟读取气压
            if (TicCount != 0 && TicCount % 30 == 0)
            {
                BarometricPressureSensor.Read();
            }
            TicCount++;
        }
    }
}
